﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="edit.aspx.cs" Inherits="edit" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>编辑页面</title>
    <link href="css/style.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <form id="form1" runat="server">
    <div>

        <asp:Repeater ID="Repeater1" runat="server">
        <HeaderTemplate>
        <table border=1>
        <tr>
        <th>ID</th>
        <th>新闻的标题</th>
        <th>新闻的内容</th>
        <th>图片的地址</th>
        <th>新闻的类别</th>
        <th>新闻日期</th>
        <th>操作</th>
        </HeaderTemplate>
        <ItemTemplate>
        <tr>
        <td><%#Eval("NewsID")%></td>
        <td><%#Eval("NewsTitle")%></td>
        <td><%#Eval("NewsData")%></td>
        <td><%#Eval("NewsImageUrl")%></td>
        <td><%#Eval("NewsCategory")%></td>
        <td><%#Eval("NewsDate")%></td>
        <td><a href="?deleteId=<%#Eval("NewsID")%>">删除</a><a href="?editId=<%#Eval("NewsID")%>">编辑</a></td>
        </tr>
        </ItemTemplate>
        <FooterTemplate>
        </table>
        </FooterTemplate>
        </asp:Repeater>
<asp:AspNetPager runat=server ID="AspNetPager1" 
            CustomInfoHTML="共%PageCount%页，当前为第%CurrentPageIndex%页，每页%PageSize%条" 
            FirstPageText="首页" LastPageText="尾页" LayoutType="Table" NextPageText="下一页" 
            PagingButtonLayoutType="Span" PrevPageText="上一页" PageSize="5" OnPageChanged="AspNetPager1_PageChanged" ShowCustomInfoSection="Right" 
            UrlPaging="True"></asp:AspNetPager>
    </div>
    <h1>添加</h1>
    新闻标题：<asp:TextBox ID="tbxNewsTitle" runat="server" Width="178px"></asp:TextBox>
    <br />
    新闻内容：<asp:TextBox ID="tbxNewsData" runat="server" Height="118px" 
        TextMode="MultiLine" Width="178px"></asp:TextBox>
    <br />
    图片地址：<asp:TextBox ID="tbxNewsimg" runat="server" Width="178px"></asp:TextBox>
    <br />
    新闻类别：<asp:DropDownList ID="rblType" runat="server" Height="16px" 
        Width="184px">
        <asp:ListItem Selected=True Value=Newsletter>时事新闻</asp:ListItem>
        <asp:ListItem Value=Financial>财经新闻</asp:ListItem>
        <asp:ListItem Value=Fun>娱乐新闻</asp:ListItem>
        <asp:ListItem Value=Sports>体育新闻</asp:ListItem>
    </asp:DropDownList>
    <br />
    发布时间：<asp:TextBox ID="tbxNewsDate" runat="server" Width="178px"></asp:TextBox>
    <br />
    <asp:Button ID="btnInsert" runat="server" Text="添加" 
        onclick="btnInsert_Click" Width="67px" />    
    <asp:Button ID="btnUpdate" runat="server" Text="编辑" onclick="btnUpdate_Click" 
        Width="69px" />
</form>
</body>
</html>
